package com.cy.pj.common.pojo;

import com.sun.org.apache.regexp.internal.RE;

public class ResponseResult {
    private Integer state=1;  //响应状态码  1表示ok 0表示error
    private String message; //状态码对应的信息
    private Object data; //正确的响应数据

    public ResponseResult(){}

    public ResponseResult(String message){ //new ResponseResult("delete ok")
        this.message = message;
    }
    public ResponseResult(Object data){ //new ResponseResult(list)
        this.data = data;
    }
    public ResponseResult(Throwable e){ //new ResponseResult(e)
        this.state=0;
        this.message= e.getMessage();
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
